package main

import (
	"fmt"
)

func main() {
	starWarsYears := map[string]int{
		"A New Hope":              1977,
		"The Empire Strikes Back": 1980,
		"Return of the Jedi":      1983,
		"Attack of the Clones":    2002,
		"Revenge of the Sith":     2005,
	}

	starWarsYears["The Force Awakens"] = 2015

	fmt.Println(len(starWarsYears))

	for k, v := range starWarsYears {
		fmt.Println(k, v)
	}

	deleteitem := "A New Hope"
	delete(starWarsYears, deleteitem)

	code, exists := starWarsYears[deleteitem]
	if exists {
		fmt.Println("delete fail?", code)
	} else {
		fmt.Println("delete ok!")
	}

	fmt.Println(len(starWarsYears))

	for k, v := range starWarsYears {
		fmt.Println(k, v)
	}
}
